/**
 * TODO: Copyright info
 */

#ifndef _AUTOSDK_HPP_
#define _AUTOSDK_HPP_

#include <string>
#if defined _WIN32 || defined __CYGWIN__
  #ifdef BUILDING_DLL
    #ifdef __GNUC__
      #define DLL_PUBLIC __attribute__ ((dllexport))
    #else
      #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
    #endif
  #else
    #ifdef __GNUC__
      #define DLL_PUBLIC __attribute__ ((dllimport))
    #else
      #define DLL_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
    #endif
  #endif
  #define DLL_LOCAL
#else
  #if __GNUC__ >= 4
    #define DLL_PUBLIC __attribute__ ((visibility ("default")))
    #define DLL_LOCAL  __attribute__ ((visibility ("hidden")))
  #else
    #define DLL_PUBLIC
    #define DLL_LOCAL
  #endif
#endif

/**
 * @brief Navinfo namespace
 * 
 */
namespace Navinfo {
/**
 * @brief Engine namespace
 * 
 */

namespace Engine {

/**
 * @brief Planning namespace
 * 
 */
namespace Planning {
    class HDRoutePlanning;
    class HDLanePlanning;
}

class IHDMap;
class DataMatcher;

/**
 * @brief The main class of AutoSDK.
 * 
 */
class AutoSDK
{
protected:
    virtual ~AutoSDK() {};
public:
    /**
     * @brief Config AutoSDK with configuration file.
     * 
     * @param IniPath   Path to config ini file.
     * @return true     Configuration succeeded.
     * @return false    Configuration failed.
     */
    virtual bool Config(const std::string& IniPath) = 0;
    /**
     * @brief Start AutoSDK.
     *        This should be called after correctly config.
     * 
     * @return true     Start succeeded.
     * @return false    Start failed.
     */
    virtual bool Start() = 0;
    /**
     * @brief Release AutoSDK.
     *        This should be called before shutdown.
     * 
     * @return true     Release succeeded.
     * @return false    Release failed.
     */
    virtual bool Release() = 0;

    /**
     * @brief Get pointer to HDRoutePlanning
     * 
     * @return Navinfo::Engine::Planning::HDRoutePlanning*  Pointer to HDRoutePlanning instance. NULL for failure.
     */
    virtual Navinfo::Engine::Planning::HDRoutePlanning* GetHDRoutePlanning() = 0;

    /**
     * @brief Get pointer to HDLanePlanning
     * 
     * @return Navinfo::Engine::Planning::HDLanePlanning*   Pointer to HDLanePlanning instance. NULL for failure.
     */
    virtual Navinfo::Engine::Planning::HDLanePlanning* GetHDLanePlanning()  = 0;

    /**
     * @brief Get pointer to HDMapQuery
     * 
     * @return Navinfo::Engine::HDMap*  Pointer to HDMapQuery instance. NULL for failure.
     */
	virtual Navinfo::Engine::IHDMap* GetHDMap() = 0;

    /**
     * @brief Get the Data Matcher object
     * 
     * @return Navinfo::Engine::DataMatcher*  Pointer to DataMatcher instance. NULL for failure.
     */
    virtual Navinfo::Engine::DataMatcher* GetDataMatcher() = 0;
};


} //namespace Engine
} //namespace Navinfo

/**
 * @brief Get AutoSDK pointer. This is a global singleton instance. It will be released at the end of lifetime.
 * 
 */
extern "C" DLL_PUBLIC Navinfo::Engine::AutoSDK* CreateAutoSDK();

#endif //_AUTOSDK_HPP_